package com.suieqian.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.suieqian.dto.req.SysMenuReq;
import com.suieqian.dto.resp.SysMenuResp;
import com.suieqian.entity.SysMenu;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 菜单service
 *
 * @author lirch
 */
public interface ISysMenuService extends IService<SysMenu> {

    /**
     * 按照id or name查询菜单
     *
     * @param ids
     * @param name
     * @return
     */
    List<SysMenuResp> getMenus(List<Long> ids, String name);

    /**
     * 按照parentId查询菜单
     *
     * @param pid
     * @return
     */
    List<SysMenuResp> listMenuByPid(Long pid);

    /**
     * 创建菜单
     *
     * @param reqVO
     * @return
     */
    Long createMenu(SysMenuReq reqVO);

    /**
     * 修改菜单
     *
     * @param reqVO
     */
    void updateMenu(SysMenuReq reqVO);

    /**
     * 删除菜单
     *
     * @param menuId
     */
    @Transactional(rollbackFor = Exception.class)
    void deleteMenu(Long menuId);


}
